/**
 * 
 */
package com.effectiv.gooruda.rest.ext;

import java.io.IOException;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.ext.Provider;

import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Component;

/**
 * @author Dhrubo
 *
 */
@Component
@Provider
@Slf4j
public class SecurityCleanupResponseFilter implements ContainerResponseFilter {

	/* (non-Javadoc)
	 * @see javax.ws.rs.container.ContainerResponseFilter#filter(javax.ws.rs.container.ContainerRequestContext, javax.ws.rs.container.ContainerResponseContext)
	 */
	public void filter(ContainerRequestContext reqCtx,
			ContainerResponseContext resCtx) throws IOException {
		
		log.info("Cleaning up request");
		
		SecurityContextHolder.remove();

	}

}
